package domain

import "strings"

type ExchangeRateDomain struct {
}

/*
*
具体的汇率的业务
*/
func (d *ExchangeRateDomain) UsdRate(uint string) float64 {
	//应该根据redis查询   定时任务调取一个真实的汇率的接口 定期存入redus
	uint = strings.ToUpper(uint)
	if "CNY" == uint {
		return 6.95
	} else if "JPY" == uint {
		return 136.23
	}
	return 0
}

func NewExchangeRateDomain() *ExchangeRateDomain {
	return &ExchangeRateDomain{}
}
